<?php

function smarty_modifier_dbpic($user)
{
	$base = "http://www.peak.com/uploads/user/";	
	if($user->photo == "default.jpg" || trim($user->photo) == "") {
		return $base . "default.jpg";
	}	
	$id = $user->id;
	$dir = (floor(($id/1000)) + 1) * 1000;
    return $base . $dir . "/" . $id . "/" . $user->photo;
}

?>
